import React from 'react';
import styles from '../index.less';
import { history, useModel } from 'umi';
const My: React.FC & { wrappers: string[] } = () => {
  let { delelogin } = useModel('user', model => ({ delelogin: model.delelogin }));
  
  function getData(){
    history.push("/address/id");
  }
  function getCang() {
    history.push('/cang');
  }
  function qingJie() {
    const tan = document.getElementById('tan');
    console.log(tan);
  }
  async function deletelo() {
    let res = await delelogin();
    console.log(res);
    history.push('/login');
  }
  return (
    <div className={styles.Zhen}>
      <div id="tan" className={styles.Tan}>
        请解锁
      </div>
      {/* 头部 */}
      <div className={styles.Top}>
        <div id="tou" className={styles.Tou}></div>
        <div id="name" className={styles.Name}>
          15630026819
        </div>
        <div id="vip" className={styles.Vip}>
          至尊会员
        </div>
      </div>
      {/* 主要内容 */}
      <div id="centre" className={styles.Centre}>
        <div id="a" className={styles.A} onClick={getCang}>
          <div id="tu">2-1</div>

          <div id="wen">我的收藏</div>
        </div>
        <div id="b" className={styles.B} onClick={getData}>
          <div id="tu">2-1</div>
          <div id="wen">地址管理</div>
        </div>
        <div id="c" className={styles.C} onClick={qingJie}>
          <div id="tu">2-1</div>
          <div id="wen">我的订单</div>
        </div>
        <div id="d" className={styles.D}>
          <div id="tu">2-1</div>
          <div id="wen">周末拼单</div>
        </div>
        <div id="e" className={styles.E}>
          <div id="tu">2-1</div>
          <div id="wen">优惠券</div>
        </div>
        <div id="f" className={styles.F}>
          <div id="tu">2-1</div>
          <div id="wen">优选购</div>
        </div>
        <div id="g" className={styles.G}>
          <div id="tu">2-1</div>
          <div id="wen">我的红包</div>
        </div>
        <div id="h" className={styles.H}>
          <div id="tu">2-1</div>
          <div id="wen">会员plus</div>
        </div>
        <div id="i" className={styles.I}>
          <div id="tu">2-1</div>
          <div id="wen">邀请返利</div>
        </div>
        <div id="j" className={styles.J}>
          <div id="tu">2-1</div>
          <div id="wen">意见反馈</div>
        </div>
        <div id="k" className={styles.K}>
          <div id="tu">2-1</div>
          <div id="wen">客服咨询</div>
        </div>
        <div id="l" className={styles.L}>
          <div id="tu">2-1</div>
          <div id="wen">账户安全</div>
        </div>
      </div>
      {/* 底部 */}
      <div id="bottom" className={styles.layouting}>
        <div id="btn" onClick={() => deletelo()} className={styles.Btn}>
          退出登录
        </div>
      </div>
    </div>
  );
};
My.wrappers = ['@/wrappers/auth'];
export default My;
